-
Notifications
You must be signed in to change notification settings - Fork 1.1k
add prctl constants on android #4531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Some changes occurred in the Android module cc @maurer |
I am not sure if those FreeBSD failures have anything to do with my change. The errors appear to be about a missing symbol that only appears in the FreeBSD path. |
#[cfg_attr(termux, link(name = "android-posix-semaphore"))] | ||
extern "C" {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this added for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Android's bionic, there are some libc functions which are not supported, like sem_open
, sem_close
, and sem_unlink
, which causes link failures when compiling anything with libc as a dependency.
On the Android terminal app Termux, there is a substitute port available as a separate library, which must be linked in explicitly.
| "toupper" | "getpwuid_r" | "tmpfile" | "getpwnam" | "getpwuid" | "tcdrain" | ||
| "cfgetispeed" | "cfgetospeed" | "cfsetispeed" | "cfsetospeed" | "tcgetattr" | ||
| "tcsetattr" | "tcflow" | "tcflush" | "tcgetsid" | "tcsendbreak" | "cfmakeraw" | ||
| "cfsetspeed" => true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These don't seem relevant to the change here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not strictly related, but tests for all these functions fail currently.
I split it out into another commit to make that clearer
Add all constants from bionic's `prctl.h` header https://android.googlesource.com/platform/bionic/+/7ac54f5c391bf3aeb9fec84a158939421fd8f505/libc/kernel/uapi/linux/prctl.h
* ignore tests on some symbols that fail with bad function pointers * detect termux app and link `libandroid-posix-semaphore` to fix link errors
e9789f7
to
f5e4401
Compare
Description
Add all constants from bionic's
prctl.h
headerSources
Checklist
libc-test/semver
have been updated*LAST
or*MAX
areincluded (see #3131)
cd libc-test && cargo test --target mytarget
);especially relevant for platforms that may not be checked in CI
@rustbot label +stable-nominated